<?php
class YouNet_Form_Element_BannerImage extends YouNet_Form_Element_File
{
	private $_specs = 'banner_image';
	private $_options = array(
		'decorators'	=> array(
			'File', 'Description', 'Errors',
			array(array('data'=>'HtmlTag'), array('tag' => 'dd')),
			array(array('label' => 'Label'), array('tag' => 'dt'))
		),
		'label'			=> "Banner image"
	);
	
	public function __construct($specs = NULL, $options = NULL)
	{
		if (isset($specs))
			$this->_specs = $specs;
		if (isset($options))
			$this->_options = array_merge($this->_options, $options);
			
		parent::__construct($this->_specs, $this->_options);
		$this->setDestination(BANNER_PATH);
		$this->addValidator('Count', false, 1);
		$this->addValidator('Size', false, '1MB');
		$this->addValidator('Extension', false, 'jpg,png,gif,jpeg');
		$this->setDescription(
            sprintf(".jpg|.png|.gif · max %s · preferred width %s for best fit on Fan Page.", '1MB','810px'
		));
	}
}